<template>
  <div class="dialog-wrapper">
    <el-dialog title="关闭订单：" :visible.sync="dialogVisible" width="30%" :before-close="cancel">
      <el-form ref="form" :model="form" label-width="80px">
        <el-form-item label="关闭理由:" prop="remark">
          <el-input v-model="form.remark" type="textarea" class="area-cls" :disabled="disable" />
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="cancel">取 消</el-button>
        <el-button type="primary" @click="confirm">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  props: {
    remark: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      form: {
        remark: ''
      },
      dialogVisible: false,
      disable: false
    }
  },
  watch: {
    remark(newVal) {
      this.form.remark = newVal
    }
  },
  methods: {
    show() {
      this.dialogVisible = true
    },
    setDisable() {
      this.disable = true
    },
    confirm() {
      this.dialogVisible = false
      this.$emit('confirm', this.form.remark)
    },
    cancel() {
      this.dialogVisible = false
    }
  }
}
</script>
<style lang="scss" scoped>
@import "@/styles/el-button.scss";
.el-form /deep/ .el-form-item__label {
  white-space: nowrap;
  color: rgba(102, 102, 102, 1);
  font-size: 14px;
  font-family: Roboto;
}
.el-form /deep/ .el-input__inner {
  width: 278px;
  height: 36px;
}
.el-form /deep/ .el-textarea__inner {
  width: 278px;
  height: 137px;
}
.dialog-footer {
  button{
    &:nth-child(1){
      background-color: rgba(255, 255, 255, 1);
      color: rgba(16, 16, 16, 1);
      font-size: 14px;
      text-align: center;
      font-family: Roboto;
    }
  }
}
.dialog-wrapper{
  .el-dialog__wrapper /deep/ .el-dialog{
    min-width: 400px !important;
  }
}
</style>
